<h2>View Author</h2>
<hr/>
<p>The Author's details and list of Volumes by this Author are detailed on this page.
 To modify this author, select the modify option.
 To delete this author, select delete.
</p>
<center>

<!-- Author information -->
<table>
<tr>
	<th align="right" width=30%>Author ID:</th>
	<td><?php echo $author->author_id; ?></td>
</tr>
<tr>
	<th align="right">Author Name:</th>
	<td><?php echo $author->author_name; ?></td>
</tr>
<tr>
	<th  class="tablehead" align="right" width=30%>Actions</th>
	<td><?php echo anchor('admin/catalogue_management/modifyAuthor/' . $author->author_id, 'Modify') . ' - ' .anchor('admin/catalogue_management/deleteAuthor/' . $author->author_id, 'Delete', array('onclick'=>"return confirm('Are you sure you wish to remove this author?');")); ?></td>
</tr>
</table>
</center>
<br />
<h3 class="lefta">List of Volumes by Author:</h3> <p><?php echo $author->author_name; ?></p>
<p> To remove a particular volume for this author, select the remove option.</p>
<center>
<!-- Volumes belonging to author -->
<table>
<tr>
	<th>Accession Number</th>
	<th>Call Number</th>
	<th>Title</th>
	<th>Catalogue Date</th>
	<th class="tablehead">Actions</th>
</tr>
<?php
foreach ($volumes->result() as $volume)
{
	echo '<tr>';
	  
	// Details
	echo '<td>' . anchor('admin/catalogue_management/viewVolume/' . $volume->access_id, $volume->access_id) . '</td>';
	echo '<td>' . $volume->call_number . '</td>';
	echo '<td>' . $volume->title . '</td>';
	echo '<td>' . $volume->catalogue_date . '</td>';
	
	// Actions
	echo '<td>';
	echo anchor('admin/catalogue_management/removeAuthor/' . $author->author_id . '/' . $volume->access_id, 'Remove', array('onclick'=>"return confirm('Are you sure you wish to remove this volume from this author?');")) . '</br>';
	echo '</br></td>';
	echo '</tr>';
}
?>
</table>

</center>
